//edit by 略游
diag_log "GF Headshot Script by GEORGE FLOROS [GR]";

if(isNull player) exitWith{};

gf_headshot_sounds	= [
"Headshot_Blow_it_out_your_ass","Headshot_Come_get_some","Headshot_Come_on","Headshot_Damn_i_m_good","Headshot_Eat_shit_and_die",
"Headshot_Game_over","Headshot_Gotta_hurt","Headshot_Holy_shit","Headshot_It_hurts_to_be_you","Headshot_lets_rock",
"Headshot_Make_day","Headshot_Mess","Headshot_Ooooh_thats_gotta_hurt","Headshot_See_you_in_hell","Headshot_Shake_it_baby",
"Headshot_Shit_happens","Headshot_Terminated","Headshot_Ugly","Headshot_Wasted","Headshot_Yippie_kaiay"
];

Headshot = 
{ 
	_this addEventHandler ["hitpart", 
	{
		if ("head" in (_this select 0 select 5)) then 
		{
			((_this select 0) select 0) RemoveEventHandler ["HitPart", _thisEventHandler];
			[parseText format["<t align='center' font='PuristaBold' size='2.8'>""击中头部""</t>" ], true, nil,  1, 0.7, 0] spawn BIS_fnc_textTiles; //7, 0.7, 0	
			[player, selectRandom gf_headshot_sounds] remoteExec ["say3D"];
		};
	}];
};

/*
[]spawn
{	
	while {true} do 
	{
		sleep 60;
		private _nears = [];
		_nears = player nearEntities["Man", 1200];
		//
		{
				if(!(_x getVariable ["GF_EΗ_Headshot",false])
					&& {!isPlayer _x}) then
				{	
					_x call Headshot;
				};
				_x setVariable ["GF_EΗ_Headshot",true];	
		}forEach _nears;
	};
};
*/